Skip to content

editoast: add authorization to the rolling stock endpoints - #17364

Merged
Sh099078 merged 31 commits into
devfrom
feature-branch/check-rolling-stock-privileges
Aug 21, 2026
Merged

editoast: add authorization to the rolling stock endpoints#17364
Sh099078 merged 31 commits into
devfrom
feature-branch/check-rolling-stock-privileges

Conversation

@younesschrifi

@younesschrifi younesschrifi commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Add authorization to the rolling stock and light rolling stock endpoints.

Related ticket: https://github.com/osrd-project/osrd-confidential/issues/1064

Warning

This PR is a feature branch and is not ready for review yet.

TODO

Backend - Add authorization on the following endpoints:

@github-actions github-actions Bot added the area:editoast Work on Editoast Service label Jun 24, 2026
@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from 61083bb to 016cefe Compare June 24, 2026 15:41
@Sh099078

Copy link
Copy Markdown
Contributor

rebased on dev

@Sh099078 Sh099078 changed the title editoast: check rolling stock privileges editoast: add authorization to the rolling stock endpoints Jun 24, 2026
@younesschrifi
younesschrifi force-pushed the feature-branch/check-rolling-stock-privileges branch from 9cda363 to af93581 Compare June 26, 2026 14:04
@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from af93581 to 49c63ff Compare June 29, 2026 14:35
@Sh099078

Copy link
Copy Markdown
Contributor

rebase on dev + update obsolete commit name in the feature branch

@younesschrifi

Copy link
Copy Markdown
Contributor Author

rebase on dev

@younesschrifi
younesschrifi force-pushed the feature-branch/check-rolling-stock-privileges branch from 25b1202 to c6e470e Compare July 3, 2026 12:33
@younesschrifi
younesschrifi force-pushed the feature-branch/check-rolling-stock-privileges branch from 77c7390 to 3d24d43 Compare July 15, 2026 07:19
@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from 89df84a to 86fba80 Compare July 17, 2026 18:46
@Sh099078

Copy link
Copy Markdown
Contributor

rebased on dev

@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from 86fba80 to 6ff73e4 Compare July 21, 2026 10:18
@Sh099078

Copy link
Copy Markdown
Contributor

rebased on dev

@github-actions github-actions Bot added area:front Work on Standard OSRD Interface modules kind:api-change labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API changes

This Pull Request introduces some changes in the API:

  • please own it: notify or even prepare dedicated PR(s) to consumer projects

@Sh099078

Copy link
Copy Markdown
Contributor

rebase on dev

@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from e6c0c41 to 91e0817 Compare July 30, 2026 19:33
@Sh099078

Copy link
Copy Markdown
Contributor

rebased on dev

Sh099078 and others added 4 commits August 21, 2026 00:34
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from 2fe5a07 to 9344908 Compare August 20, 2026 22:36
Sh099078 and others added 12 commits August 21, 2026 00:37
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
The endpoint is supposed to be only used by core. When authorization is
not skipped, deny anyone who is not an admin.

Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
The issuer must have the Reader grant on the rolling stocks.

Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
When a Rs is unauthorized, the train should be unsimulated

Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
@Sh099078
Sh099078 force-pushed the feature-branch/check-rolling-stock-privileges branch from 9344908 to 386e47a Compare August 20, 2026 22:37
@Sh099078
Sh099078 marked this pull request as ready for review August 20, 2026 23:06
@Sh099078
Sh099078 requested review from a team as code owners August 20, 2026 23:06
@Sh099078
Sh099078 requested a review from leovalais August 20, 2026 23:06
@Sh099078 Sh099078 moved this to Awaiting merge in Board PI 21 Aug 20, 2026

@leovalais leovalais left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor review items there: #18090 (comment)

Thank you for the load of new tests! It makes working with permissions much easier.

A few notes:

  • The main issue for me is the complexity of permission-checking code, hopefully #18090 solves that.
  • We're bound to have a lot more tests in views as we add new authorized resources. Two issues with that:
    • Running time. They are the tests that take the longest to run. That won't help with CI slowness. We have to move forward with the split in crates to eventually end up with several views crates. We'll be able to run their tests in parallel.
    • Code length. Train schedule tests are long and complex. (Just like train schedule-related endpoints tbh.) We'll have to think of something because it's the most complex part of editoast and yet it's also the hardest to navigate and test thoroughly.

🚀

@Sh099078
Sh099078 added this pull request to the merge queue Aug 21, 2026
Merged via the queue into dev with commit 7cf3e12 Aug 21, 2026
39 checks passed
@Sh099078
Sh099078 deleted the feature-branch/check-rolling-stock-privileges branch August 21, 2026 13:57
@github-project-automation github-project-automation Bot moved this from Awaiting merge to Awaiting Validation in Board PI 21 Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editoast Work on Editoast Service area:front Work on Standard OSRD Interface modules kind:api-change

Projects

Status: Awaiting Validation

Development

Successfully merging this pull request may close these issues.

5 participants